MySQL Date and Time Data Types
MySQL provides several dedicated data types to store dates, times, or a combination of both.
DATE – Stores only the date (YYYY-MM-DD).
TIME – Stores only the time (HH:MM:SS).
DATETIME – Stores both date and time (YYYY-MM-DD HH:MM:SS).
TIMESTAMP – Similar to DATETIME but stored as Unix timestamp and affected by time zone.
YEAR – Stores a year in 2-digit or 4-digit format.